﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Code.Models;
using System.Web.Mvc;
using Code.Commen;
using System.ComponentModel.DataAnnotations;

namespace QianBuo.Lottery.Web.Models.Surrogate
{

    [Serializable]
    public class AccountReportModel
    {
        public AccountReportModel()
        {
            Serch = new Code.BLL.UserManage.UserAccountReportSerch();
        }
        public Code.BLL.UserManage.UserAccountReportSerch Serch { get; set; }

        public int Page { get; set; }
        public int PageSize { get; set; }
        public int SumCount { get; set; }
        public Guid? uid { get; set; }
        public DateTime MinSerchTime { get; set; }
        public DateTime MaxSerchTime { get; set; }
        public List<SelectListItem> UserTypes { get; set; }
        public AccountReport SumReport { get; set; }
        public IEnumerable<AccountReport> Reports { get; set; }
    }

    [Serializable]
    public class PlayTypeUserModel
    {
        public bool UseSiteBackMoneyRatio { get; set; }
        public bool UseSiteWinMoney { get; set; }
        public Guid Uid { get; set; }
        public string UserName { get; set; }
        public LotteryTypeType? LotteryID { get; set; }
        public ModelNameValue<LotteryTypeType, string> Lotterys { get; set; }
        [Required]
        public Code.BLL.PlayTypeOptionManage.BackMoney[] Options { get; set; }


    }


    [Serializable]
    public class TeamReportModel
    {
        public int? Page { get; set; }
        public int? PageSize { get; set; }
        public int SumCount { get; set; }
        public Guid? Uid { get; set; }
        public LotteryType? Lottery { get; set; }
        public List<SelectListItem> Lotterys { get; set; }
        public IEnumerable<Key<string, Guid>> Path { get; set; }
        public Code.BLL.UserManage.UserAccountDetailSerch Search { get; set; }
        public AccountReport SelfReport { get; set; }
        public AccountReport SumReport { get; set; }
        public IEnumerable<AccountReport> Report { get; set; }
    }


    [Serializable]
    public class AccountReport
    {
        public string LoginName { get; set; }
        public Guid UserID { get; set; }
        public short UserType { get; set; }
        public double? AddMoney { get; set; }
        public double? TackMoney { get; set; }
        public double? PlayMoney { get; set; }
        public double? BackMoney { get; set; }
        public double? BackMoney_Child { get; set; }
        public double? WinMoney { get; set; }
        public double? WinMoney_Child { get; set; }
    }

    [Serializable]
    public class GroupMoneyModel
    {
        /// <summary>
        /// 账户详情
        /// </summary>
        public class AccountDetail
        {
            public string LoginName { get; set; }
            public short UserType { get; set; }
            /// <summary>
            /// 余额
            /// </summary>
            public double Balance { get; set; }
            /// <summary>
            /// 冻结金额
            /// </summary>
            public double Freez { get; set; }

            /// <summary>
            /// 总充值金额
            /// </summary>
            public double AddMoney { get; set; }
            /// <summary>
            /// 总返点金额
            /// </summary>
            public double BackMoney { get; set; }
            /// <summary>
            /// 总下级返点金额
            /// </summary>
            public double BackMoney_Child { get; set; }
            /// <summary>
            /// 总购彩金额
            /// </summary>
            public double Buy { get; set; }
            /// <summary>
            /// 总提款金额
            /// </summary>
            public double TackMoney { get; set; }
            /// <summary>
            /// 总中奖金额
            /// </summary>
            public double WinMoney { get; set; }
            /// <summary>
            /// 总下级返奖金额
            /// </summary>
            public double WinMoney_Child { get; set; }
        }
        /// <summary>
        /// 当前用户
        /// </summary>
        public Guid? CurrenUid { get; set; }
        /// <summary>
        /// 当前用户的登录名
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// 登录用户
        /// </summary>
        public Guid? LoginUid { get; set; }
        /// <summary>
        /// 当前用户的上级
        /// </summary>
        public Dictionary<Key<Guid, Guid?>, string> CurrentUserCommands { get; set; }
        /// <summary>
        /// 当前用户下级账户详情
        /// </summary>
        public Dictionary<Guid, AccountDetail> ChildAccountDetail { get; set; }
        public PageInfo PageInfo { get; set; }
        /// <summary>
        /// 直属下级所有balance，Freez，all的和
        /// </summary>
        public AccountDetail ChildsAccountSum { get; set; }
        /// <summary>
        /// 整个团队所有balance，Freez，all的和
        /// </summary>
        public AccountDetail AllChildsAccountSum { get; set; }
        /// <summary>
        /// 要查找范围的起始时间
        /// </summary>
        public DateTime? StartTime { get; set; }
        /// <summary>
        /// 要查找范围的结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }
    }
}